package bcc.java8.chap05;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * .
 *
 * @author: bcc
 * 2020/11/4
 */
public class FlatMapTest {
    public static void main(String[] args) {
        List<String> words = Arrays.asList("Hello", "Word","Java","In", "Action");
        List<String[]> collect = words.stream().map(w -> w.split(""))
                .distinct().collect(Collectors.toList());
        System.out.println(collect);
        List<String> ws = words.stream().map(w -> w.split("")).flatMap(Arrays::stream).distinct().collect(Collectors.toList());
        System.out.println(ws);
    }
}
